const fs =require('node:fs');
fs.writeFileSync('./index.txt','22222',{
  encoding:'utf8',
  flag:'a+',
})
fs.appendFileSync('./index.txt','33333')

// const writeStream = fs.createWriteStream('./index.txt',{
//   flag:'a+',
//   encoding:'utf8',
// });
//
// writeStream.write('4444')
// writeStream.end()
// writeStream.on('finish',()=>{
//   console.log('finish')
// })